Remove GdkDragProtocol from the api
authorMatthias Clasen <mclasen@redhat.com>
Thu, 24 Aug 2017 21:40:16 +0000 (17:40 -0400)
committerBenjamin Otte <otte@redhat.com>
Sun, 3 Dec 2017 05:41:08 +0000 (06:41 +0100)
...together with apis that return it. We were not using this
information in GTK+ at all, so no need to provide it.

18 files changed:
gdk/broadway/gdkdnd-broadway.c
gdk/broadway/gdkprivate-broadway.h
gdk/broadway/gdkwindow-broadway.c
gdk/gdkdnd.c
gdk/gdkdnd.h
gdk/gdkdndprivate.h
gdk/gdkinternals.h
gdk/gdkwindow.c
gdk/gdkwindow.h
gdk/gdkwindowimpl.h
gdk/mir/gdkmirwindowimpl.c
gdk/wayland/gdkdnd-wayland.c
gdk/wayland/gdkprivate-wayland.h
gdk/wayland/gdkwindow-wayland.c
gdk/win32/gdkdnd-win32.c
gdk/win32/gdkprivate-win32.h
gdk/win32/gdkwindow-win32.c
gdk/x11/gdkwindow-x11.c

index ebb36797ca81f9fac42e913c942ebe3be42e7c9a..264da5e5f0cc3211bdb47f59767670836bba88ff 100644 (file)
@@ -102,13 +102,6 @@ _gdk_broadway_window_drag_begin (GdkWindow         *window,
   return new_context;
 }
 
-GdkDragProtocol
-_gdk_broadway_window_get_drag_protocol (GdkWindow *window,
-                                       GdkWindow **target)
-{
-  return GDK_DRAG_PROTO_NONE;
-}
-
 static GdkWindow *
 gdk_broadway_drag_context_find_window (GdkDragContext  *context,
                                       GdkWindow       *drag_window,
index 3d8faaa2411728fbe556b439a4bd6aeb47719798..250c81c0767253b35c286571b3338a82c84fbbeb 100644 (file)
@@ -104,8 +104,6 @@ void _gdk_broadway_display_init_root_window (GdkDisplay *display);
 void _gdk_broadway_display_init_dnd (GdkDisplay *display);
 GdkDisplay * _gdk_broadway_display_open (const gchar *display_name);
 void _gdk_broadway_display_queue_events (GdkDisplay *display);
-GdkDragProtocol _gdk_broadway_window_get_drag_protocol (GdkWindow *window,
-                                                       GdkWindow **target);
 GdkCursor*_gdk_broadway_display_get_cursor_for_name (GdkDisplay  *display,
                                                     const gchar *name);
 GdkCursor *_gdk_broadway_display_get_cursor_for_texture (GdkDisplay *display,
index 9eb817398a6b38c1930db2cc0a582a2616ddfd1c..0dec3abb30215e6ce437c63a32e614c7b0539101 100644 (file)
@@ -1499,5 +1499,4 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
   impl_class->get_property = _gdk_broadway_window_get_property;
   impl_class->change_property = _gdk_broadway_window_change_property;
   impl_class->delete_property = _gdk_broadway_window_delete_property;
-  impl_class->get_drag_protocol = _gdk_broadway_window_get_drag_protocol;
 }
index 94d256595b8f6e1e8d09eb9aaa99ec2578d52cad..5bf0ab3aa5bb2c038cb87d540262d0adc71789ea 100644 (file)
@@ -182,24 +182,6 @@ gdk_drag_context_get_dest_window (GdkDragContext *context)
   return context->dest_window;
 }
 
-/**
- * gdk_drag_context_get_protocol:
- * @context: a #GdkDragContext
- *
- * Returns the drag protocol thats used by this context.
- *
- * Returns: the drag protocol
- *
- * Since: 3.0
- */
-GdkDragProtocol
-gdk_drag_context_get_protocol (GdkDragContext *context)
-{
-  g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_DRAG_PROTO_NONE);
-
-  return context->protocol;
-}
-
 /**
  * gdk_drag_context_set_device:
  * @context: a #GdkDragContext
@@ -362,7 +344,7 @@ gdk_drag_context_class_init (GdkDragContextClass *klass)
                   G_TYPE_NONE, 1, GDK_TYPE_DRAG_ACTION);
 }
 
-/**
+/*
  * gdk_drag_find_window:
  * @context: a #GdkDragContext
  * @drag_window: a window which may be at the pointer position, but
index e29a07d3ad2753c80ac6936a0956ab2ee3c371e8..d7eac34d86a2135e202bc689f884c21c8c592ff9 100644 (file)
@@ -80,34 +80,6 @@ typedef enum {
   GDK_DRAG_CANCEL_ERROR
 } GdkDragCancelReason;
 
-/**
- * GdkDragProtocol:
- * @GDK_DRAG_PROTO_NONE: no protocol.
- * @GDK_DRAG_PROTO_MOTIF: The Motif DND protocol. No longer supported
- * @GDK_DRAG_PROTO_XDND: The Xdnd protocol.
- * @GDK_DRAG_PROTO_ROOTWIN: An extension to the Xdnd protocol for
- *  unclaimed root window drops.
- * @GDK_DRAG_PROTO_WIN32_DROPFILES: The simple WM_DROPFILES protocol.
- * @GDK_DRAG_PROTO_OLE2: The complex OLE2 DND protocol (not implemented).
- * @GDK_DRAG_PROTO_LOCAL: Intra-application DND.
- * @GDK_DRAG_PROTO_WAYLAND: Wayland DND protocol.
- *
- * Used in #GdkDragContext to indicate the protocol according to
- * which DND is done.
- */
-typedef enum
-{
-  GDK_DRAG_PROTO_NONE = 0,
-  GDK_DRAG_PROTO_MOTIF,
-  GDK_DRAG_PROTO_XDND,
-  GDK_DRAG_PROTO_ROOTWIN,
-  GDK_DRAG_PROTO_WIN32_DROPFILES,
-  GDK_DRAG_PROTO_OLE2,
-  GDK_DRAG_PROTO_LOCAL,
-  GDK_DRAG_PROTO_WAYLAND
-} GdkDragProtocol;
-
-
 GDK_AVAILABLE_IN_ALL
 GType            gdk_drag_context_get_type             (void) G_GNUC_CONST;
 
@@ -130,8 +102,6 @@ GDK_AVAILABLE_IN_ALL
 GdkWindow       *gdk_drag_context_get_source_window    (GdkDragContext *context);
 GDK_AVAILABLE_IN_ALL
 GdkWindow       *gdk_drag_context_get_dest_window      (GdkDragContext *context);
-GDK_AVAILABLE_IN_ALL
-GdkDragProtocol  gdk_drag_context_get_protocol         (GdkDragContext *context);
 
 /* Destination side */
 GDK_AVAILABLE_IN_ALL
@@ -166,14 +136,6 @@ GdkDragContext *        gdk_drag_begin_from_point       (GdkWindow
                                                          gint                    x_root,
                                                          gint                    y_root);
 
-GDK_AVAILABLE_IN_ALL
-void    gdk_drag_find_window (GdkDragContext   *context,
-                              GdkWindow        *drag_window,
-                              gint              x_root,
-                              gint              y_root,
-                              GdkWindow       **dest_window,
-                              GdkDragProtocol  *protocol);
-
 GDK_AVAILABLE_IN_ALL
 gboolean        gdk_drag_drop_succeeded (GdkDragContext *context);
 
index e4c223b0bd225664f5b3a717119a72ca592b8c39..78ae19b4e32c8811a6f1febfe5d8b6af67710cf5 100644 (file)
 G_BEGIN_DECLS
 
 
+/*
+ * GdkDragProtocol:
+ * @GDK_DRAG_PROTO_NONE: no protocol.
+ * @GDK_DRAG_PROTO_MOTIF: The Motif DND protocol. No longer supported
+ * @GDK_DRAG_PROTO_XDND: The Xdnd protocol.
+ * @GDK_DRAG_PROTO_ROOTWIN: An extension to the Xdnd protocol for
+ *  unclaimed root window drops.
+ * @GDK_DRAG_PROTO_WIN32_DROPFILES: The simple WM_DROPFILES protocol.
+ * @GDK_DRAG_PROTO_OLE2: The complex OLE2 DND protocol (not implemented).
+ * @GDK_DRAG_PROTO_LOCAL: Intra-application DND.
+ * @GDK_DRAG_PROTO_WAYLAND: Wayland DND protocol.
+ *
+ * Used in #GdkDragContext to indicate the protocol according to
+ * which DND is done.
+ */
+typedef enum
+{
+  GDK_DRAG_PROTO_NONE = 0,
+  GDK_DRAG_PROTO_MOTIF,
+  GDK_DRAG_PROTO_XDND,
+  GDK_DRAG_PROTO_ROOTWIN,
+  GDK_DRAG_PROTO_WIN32_DROPFILES,
+  GDK_DRAG_PROTO_OLE2,
+  GDK_DRAG_PROTO_LOCAL,
+  GDK_DRAG_PROTO_WAYLAND
+} GdkDragProtocol;
+
 #define GDK_DRAG_CONTEXT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
 #define GDK_IS_DRAG_CONTEXT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAG_CONTEXT))
 #define GDK_DRAG_CONTEXT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
@@ -136,6 +163,13 @@ void     gdk_drag_abort  (GdkDragContext *context,
 void     gdk_drag_drop   (GdkDragContext *context,
                           guint32         time_);
 
+void     gdk_drag_find_window             (GdkDragContext   *context,
+                                           GdkWindow        *drag_window,
+                                           gint              x_root,
+                                           gint              y_root,
+                                           GdkWindow       **dest_window,
+                                           GdkDragProtocol  *protocol);
+
 
 
 G_END_DECLS
index 4dd2c9368f3df9655a44263c958a35fb9fbfab8f..85d51a0c4bc45b49538b9d984e800b9c0bb2dcb3 100644 (file)
@@ -33,6 +33,7 @@
 #include "gdkdisplay.h"
 #include "gdkeventsprivate.h"
 #include "gdkenumtypes.h"
+#include "gdkdndprivate.h"
 
 G_BEGIN_DECLS
 
index ec1bb02102e0709bc52d8d093f69e6ba41d7dcdf..682893ea089b3556fc63e3f34c38d81d3c27b9a5 100644 (file)
@@ -6923,28 +6923,6 @@ gdk_window_register_dnd (GdkWindow *window)
   GDK_WINDOW_IMPL_GET_CLASS (window->impl)->register_dnd (window);
 }
 
-/**
- * gdk_window_get_drag_protocol:
- * @window: the destination window
- * @target: (out) (allow-none) (transfer full): location of the window
- *    where the drop should happen. This may be @window or a proxy window,
- *    or %NULL if @window does not support Drag and Drop.
- *
- * Finds out the DND protocol supported by a window.
- *
- * Returns: the supported DND protocol.
- *
- * Since: 3.0
- */
-GdkDragProtocol
-gdk_window_get_drag_protocol (GdkWindow  *window,
-                              GdkWindow **target)
-{
-  g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_DRAG_PROTO_NONE);
-
-  return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_drag_protocol (window, target);
-}
-
 /**
  * gdk_drag_begin:
  * @window: the source window for this drag.
index a75d296121ecb33fb328400a6538ea2850c55bca..61f66ce19c28b8ea2d531ad3e85c6eb5e22b1541 100644 (file)
@@ -788,11 +788,6 @@ void          gdk_window_set_opacity     (GdkWindow       *window,
 GDK_AVAILABLE_IN_ALL
 void          gdk_window_register_dnd    (GdkWindow       *window);
 
-GDK_AVAILABLE_IN_ALL
-GdkDragProtocol
-              gdk_window_get_drag_protocol(GdkWindow      *window,
-                                           GdkWindow     **target);
-
 GDK_AVAILABLE_IN_ALL
 void gdk_window_begin_resize_drag            (GdkWindow     *window,
                                               GdkWindowEdge  edge,
index 8c15aebfc0c8e9c3d4caf0324eafe3cac8ba8ac8..af063a8f5800ced7eb265156155fd6395cb88705 100644 (file)
@@ -216,8 +216,6 @@ struct _GdkWindowImplClass
   void         (* set_opacity)          (GdkWindow *window,
                                         gdouble    opacity);
   void         (* destroy_notify)       (GdkWindow *window);
-  GdkDragProtocol (* get_drag_protocol) (GdkWindow *window,
-                                         GdkWindow **target);
   void         (* register_dnd)         (GdkWindow *window);
   GdkDragContext * (*drag_begin)        (GdkWindow        *window,
                                          GdkDevice        *device,
index e71f19cd92c25086ab97a27f296719bd7d2adf46..a820170bad1e6ebc3b43254d1189bcf934464cf0 100644 (file)
@@ -1659,13 +1659,6 @@ gdk_mir_window_impl_destroy_notify (GdkWindow *window)
 {
 }
 
-static GdkDragProtocol
-gdk_mir_window_impl_get_drag_protocol (GdkWindow *window,
-                                       GdkWindow **target)
-{
-  return 0;
-}
-
 static void
 gdk_mir_window_impl_register_dnd (GdkWindow *window)
 {
@@ -2272,7 +2265,6 @@ gdk_mir_window_impl_class_init (GdkMirWindowImplClass *klass)
   impl_class->configure_finished = gdk_mir_window_impl_configure_finished;
   impl_class->set_opacity = gdk_mir_window_impl_set_opacity;
   impl_class->destroy_notify = gdk_mir_window_impl_destroy_notify;
-  impl_class->get_drag_protocol = gdk_mir_window_impl_get_drag_protocol;
   impl_class->register_dnd = gdk_mir_window_impl_register_dnd;
   impl_class->drag_begin = gdk_mir_window_impl_drag_begin;
   impl_class->process_updates_recurse = gdk_mir_window_impl_process_updates_recurse;
index febd0e0e54f605a759a1bad19d0b4abb614b7c29..d8a3d4edf2d0c23a09c09190ecdc9b0c152fab3a 100644 (file)
@@ -484,12 +484,6 @@ gdk_wayland_drag_context_class_init (GdkWaylandDragContextClass *klass)
   context_class->commit_drag_status = gdk_wayland_drag_context_commit_status;
 }
 
-GdkDragProtocol
-_gdk_wayland_window_get_drag_protocol (GdkWindow *window, GdkWindow **target)
-{
-  return GDK_DRAG_PROTO_WAYLAND;
-}
-
 void
 _gdk_wayland_window_register_dnd (GdkWindow *window)
 {
index ef7f52a0bbab2b6537bb8ca924eb5e5deab12a8a..f650b31d133915f84a37d8c758a9f26dd47fc7b5 100644 (file)
@@ -89,8 +89,6 @@ guint      _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display,
                                                      guint             *next_image_delay);
 
 void       gdk_wayland_window_sync (GdkWindow *window);
-GdkDragProtocol _gdk_wayland_window_get_drag_protocol (GdkWindow *window,
-                                                      GdkWindow **target);
 
 void            _gdk_wayland_window_register_dnd          (GdkWindow *window);
 GdkDragContext *_gdk_wayland_window_drag_begin            (GdkWindow *window,
index 224c6420f56c91b798084d49b0834014def84829..a2a4c038b5d9eedba982042c13bb8a4f4e3e28ba 100644 (file)
@@ -3686,7 +3686,6 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
   impl_class->begin_move_drag = gdk_wayland_window_begin_move_drag;
   impl_class->set_opacity = gdk_wayland_window_set_opacity;
   impl_class->destroy_notify = gdk_wayland_window_destroy_notify;
-  impl_class->get_drag_protocol = _gdk_wayland_window_get_drag_protocol;
   impl_class->register_dnd = _gdk_wayland_window_register_dnd;
   impl_class->drag_begin = _gdk_wayland_window_drag_begin;
   impl_class->get_property = gdk_wayland_window_get_property;
index acc04ea944ed0dddfafc4df1b86893ae36b4f302..ea4deb056ed0681435a8a095619a50d4beb90499 100644 (file)
@@ -2152,34 +2152,6 @@ _gdk_win32_dnd_do_dragdrop (void)
     }
 }
 
-/* Untested, may not work ...
- * ... but as of this writing is only used by exlusive X11 gtksocket.c
- */
-GdkDragProtocol
-_gdk_win32_window_get_drag_protocol (GdkWindow *window,
-                                     GdkWindow **target)
-{
-  GdkDragProtocol protocol = GDK_DRAG_PROTO_NONE;
-
-  if (gdk_window_get_window_type (window) != GDK_WINDOW_FOREIGN)
-    {
-      if (g_object_get_data (G_OBJECT (window), "gdk-dnd-registered") != NULL)
-       {
-         if (use_ole2_dnd)
-           protocol = GDK_DRAG_PROTO_OLE2;
-         else
-           protocol = GDK_DRAG_PROTO_LOCAL;
-       }
-    }
-
-  if (target)
-    {
-      *target = NULL;
-    }
-
-  return protocol;
-}
-
 typedef struct {
   gint x;
   gint y;
index 414e972f8411da8a9d385aa668cebcb99596357d..ae2be8cdc714a8c74f12e3e39989a1efb0ab88bc 100644 (file)
@@ -177,9 +177,6 @@ void _gdk_win32_window_move_region (GdkWindow       *window,
 void _gdk_win32_selection_init (void);
 void _gdk_win32_dnd_exit (void);
 
-GdkDragProtocol _gdk_win32_window_get_drag_protocol (GdkWindow *window,
-                                                    GdkWindow **target);
-
 void    gdk_win32_handle_table_insert  (HANDLE   *handle,
                                         gpointer data);
 void    gdk_win32_handle_table_remove  (HANDLE handle);
index 24db897265474a20c0f0d456bdcf9e186719c182..5e784e8858c2ec93b27100151d3117eac7a94f9f 100644 (file)
@@ -5941,7 +5941,6 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
   impl_class->begin_move_drag = gdk_win32_window_begin_move_drag;
   impl_class->set_opacity = gdk_win32_window_set_opacity;
   impl_class->destroy_notify = gdk_win32_window_destroy_notify;
-  impl_class->get_drag_protocol = _gdk_win32_window_get_drag_protocol;
   impl_class->register_dnd = _gdk_win32_window_register_dnd;
   impl_class->drag_begin = _gdk_win32_window_drag_begin;
   impl_class->get_property = _gdk_win32_window_get_property;
index 3764d4c0547ddf74c0c7c4f18714c3830a33a7d2..3c9106a3dd3d95ac07dc17d91d13f465f7bf4fdc 100644 (file)
@@ -1224,32 +1224,6 @@ gdk_x11_window_destroy_notify (GdkWindow *window)
   g_object_unref (window);
 }
 
-static GdkDragProtocol
-gdk_x11_window_get_drag_protocol (GdkWindow *window,
-                                  GdkWindow **target)
-{
-  GdkDragProtocol protocol;
-  GdkDisplay *display;
-  guint version;
-  Window xid;
-
-  display = gdk_window_get_display (window);
-  xid = _gdk_x11_display_get_drag_protocol (display,
-                                            GDK_WINDOW_XID (window->impl_window),
-                                            &protocol,
-                                            &version);
-
-  if (target)
-    {
-      if (xid != None)
-        *target = gdk_x11_window_foreign_new_for_display (display, xid);
-      else
-        *target = NULL;
-    }
-
-  return protocol;
-}
-
 static void
 update_wm_hints (GdkWindow *window,
                 gboolean   force)
@@ -4993,7 +4967,6 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
   impl_class->begin_move_drag = gdk_x11_window_begin_move_drag;
   impl_class->set_opacity = gdk_x11_window_set_opacity;
   impl_class->destroy_notify = gdk_x11_window_destroy_notify;
-  impl_class->get_drag_protocol = gdk_x11_window_get_drag_protocol;
   impl_class->register_dnd = _gdk_x11_window_register_dnd;
   impl_class->drag_begin = _gdk_x11_window_drag_begin;
   impl_class->get_property = _gdk_x11_window_get_property;